﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace LevelEditor.Model.Entity
{
    [Serializable]
    public class SpriteSheet
    {
        // Properties
        public int AnimCellHeight { get; set; }

        public int AnimCellWidth { get; set; }

        public int CellHeight { get; set; }

        public int CellWidth { get; set; }

        public int EndCellIndex { get; set; }

        public int FrameDuration { get; set; }

        [XmlIgnore]
        public Uri ImageSource { get; set; }

        [XmlIgnore]
        public string ImageSourceStr
        {
            get
            {
                if (this.ImageSource == null)
                {
                    return string.Empty;
                }
                return this.ImageSource.OriginalString;
            }
            set
            {
                this.ImageSource = new Uri(value, UriKind.Relative);
            }
        }

        public string Name { get; set; }

        public int SpriteSheetID { get; set; }

        public int StartCellIndex { get; set; }

        public int TotalFrames { get; set; }
    }


}
